/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.dandsoft.mavrep.web;

/**
 *
 * @author fin
 */
public class StringUtils {

    public static String concatenate(String[] strs, int offset, int length,
                                     String prefix, String delimiter, String suffix) {
        StringBuilder builder = new StringBuilder();
        builder.append(prefix == null ? "" : prefix);
        for(int i=offset; i < offset + length; i++) {
            builder.append(strs[i]).append(delimiter);
        }
        builder.setLength(builder.length() - 1);
        builder.append(suffix == null ? "" : suffix);
        return builder.toString();
    }
}
